package com.action.customer;

import com.db.customer.*;

public class UpdateOkAction {

	private int no;
	private int boardtype;
	private String subject;
	private String content;
	private String pwd;
	private String result;
	private CustomerDAO customer;

	public CustomerDAO getCustomer() {
		return customer;
	}

	public void setCustomer(CustomerDAO customer) {
		this.customer = customer;
	}

	public int getNo() {
		return no;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public int getBoardtype() {
		return boardtype;
	}

	public void setBoardtype(int boardtype) {
		this.boardtype = boardtype;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public String getResult() {
		return result;
	}

	public String execute() throws Exception {

		CustomerVO vo = new CustomerVO();
		vo = customer.customerFind(no);
		if (vo.getPwd().equals(pwd)) {

			result = "OK";

			vo.setNo(no);
			vo.setSubject(subject);
			vo.setContent(content);

			customer.customerUpdate(vo);
		} else {
			result = "NO";
		}

		return "success";
	}
}
